<?php
class Project extends AppModel{
	public $name='Project';
	 
	public $validate = array(		
		'name' => array(array('rule'=>'notEmpty','message'=>'Can not be empty!')),
		'code' => array(array('rule'=>'notEmpty','message'=>'Can not be empty!'),
						array('rule'=>array('unique','code'),'message'=>'data is already existed')
						));
						
	
	public $hasMany = array(
        
        'ProjectUser' => array(
            'className'     => 'ProjectUser', 
 			'foreignKey'=>'project_id',
            'dependent'=> true
        )
    );  
    
    public $belongsTo = array(
		 'Status' => array(
		 'className' => 'Status',
		 'foreignKey' => 'status_id'
		 ),
		 
		 'Priority' => array(
		 'className' => 'Priority',
		 'foreignKey' => 'priority_id'
		 )
		 );
		  
}
?>
